﻿@model ViewModels.User.NameModel
@{
	int id = Convert.ToInt32(ViewContext.RouteData.Values["id"]);
}
<button type="submit" zyf-shown-userId="@id" hidden data-toggle="modal" data-target="#change-names" class="btn btn-sm btn-primary float-right">修改</button>
<h2 class="page-header">
	<span><b>@Model.NickName</b> 的主页（<small>登录用户名：@Model.LogonName</small>）</span>
</h2>

<div id="change-names" class="modal fade" tabindex="-1" role="dialog">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-body">
				<form zyf-usernames-change>
					<partial name="_Name" />
					<button type="submit" class="btn btn-sm btn-primary">提交</button>
				</form>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal-dialog -->
</div><!-- /.modal -->

<script>
	$(function () {
		$('[zyf-usernames-change]').submit(function (event) {
			formSubmit(event, {
				url: '/api/User/ChangeNames',
				success: function (data) {
					console.log('good!');
				}
			});
		})
	})
</script>